<template>
	<view class="topBar">
    <view
      :class="item.isChecked === false ? 'innerVal' : 'checkedIt'"
      v-for="(item,index) in list"
      :key="index"
      @click="checkedEm(index)">
      <view class="bottomLine"></view>
      {{ item.name }}
    </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
        
			}
		},
    
    props:{
      list: {
        type: Array,
        default: []
      }
    },
		onLoad() {},
		methods: {
      checkedEm(index){
        this.$emit('checkedEm',index);
      }
		}
	}
</script>

<style lang="scss" scoped>
.topBar {
  width: 100%;
  height: 100rpx;
  display: flex;
  justify-content: space-around;
  line-height: 100rpx;
  position: fixed;
  top: 0;
  background-color: #fff !important;
  z-index: 99;

}
.innerVal {
  width: 33%;
  text-align: center;
  position: relative;
  color: #cdcdcd;
}
.checkedIt {
  width: 33%;
  text-align: center;
  position: relative;
  font-size: 35rpx;
  color: #000;
  .bottomLine {
    position: absolute;
    width: 40rpx;
    height: 6px;
    bottom: 10rpx;
    left: 50%;
    background-color: #000;
    transform: translate(-20rpx);
  }
}
</style>
